package cn.yuanqiao.archive.appManager.domain;/**
 * @author 赵常飞
 * @date 2023/9/6 16:50
 */

import cn.yuanqiao.common.annotation.IdAnnotation;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 *
 *@AUTHOR:赵常飞
 *@date 2023/9/6 16:50
 */
public class TenantRelevance extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_RELEVANCE";

    public TenantRelevance() {
        String tenantCode = SecurityUtils.getTenantCode();
        if(StringUtils.isEmpty(tenantCode)){
            throw new ServiceException("TenantCode is null");
        }else {
            this.tableName = tenantCode.toUpperCase()+BIGTABLENAME;
        }
    }
    private String tableName;
    @IdAnnotation
    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long id;

    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long groupId;

    private String fieldName;

    private Integer fieldType;

    private Integer fieldLevel;

    private String releField;

    private Integer relefieldType;

    private Integer relefieldLevel;

    private Integer relation;

    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long creator;

    private String createDate;

    @JsonFormat(shape = JsonFormat.Shape.STRING)//转化成string传到前端
    private Long updater;

    private String updateDate;

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getFieldType() {
        return fieldType;
    }

    public void setFieldType(Integer fieldType) {
        this.fieldType = fieldType;
    }

    public String getReleField() {
        return releField;
    }

    public void setReleField(String releField) {
        this.releField = releField;
    }

    public Integer getRelefieldType() {
        return relefieldType;
    }

    public void setRelefieldType(Integer relefieldType) {
        this.relefieldType = relefieldType;
    }

    public Integer getRelation() {
        return relation;
    }

    public void setRelation(Integer relation) {
        this.relation = relation;
    }

    public Long getCreator() {
        return creator;
    }

    public void setCreator(Long creator) {
        this.creator = creator;
    }

    public Long getUpdater() {
        return updater;
    }

    public void setUpdater(Long updater) {
        this.updater = updater;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(String updateDate) {
        this.updateDate = updateDate;
    }

    public Long getGroupId() {
        return groupId;
    }

    public void setGroupId(Long groupId) {
        this.groupId = groupId;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public Integer getFieldLevel() {
        return fieldLevel;
    }

    public void setFieldLevel(Integer fieldLevel) {
        this.fieldLevel = fieldLevel;
    }

    public Integer getRelefieldLevel() {
        return relefieldLevel;
    }

    public void setRelefieldLevel(Integer relefieldLevel) {
        this.relefieldLevel = relefieldLevel;
    }
}
